Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement minimal coerce and corresponding tests #1772

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

deepyaman
Copy link
Collaborator

This builds on top of #1766 and serves to:

  1. demonstrate how we could generate Ibis data using Hypothesis (by way of Polars)
  2. implement basic coerce functionality

@deepyaman
Copy link
Collaborator Author

@datajoely FYI I ended up going down the rabbit hole you mentioned myself:

image

However, I found the Ibis memtable strategy (leveraging the Hypothesis pandas extra) quite limiting—at least, I couldn't get it working for most types. I found it easier to just wrap the nice Polars strategy. 😁

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.78%. Comparing base (4df61da) to head (4525218).
Report is 148 commits behind head on ibis-dev.

Additional details and impacted files
@@             Coverage Diff              @@
##           ibis-dev    #1772      +/-   ##
============================================
- Coverage     94.29%   92.78%   -1.51%     
============================================
  Files            91      130      +39     
  Lines          7024     9458    +2434     
============================================
+ Hits           6623     8776    +2153     
- Misses          401      682     +281     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@deepyaman deepyaman force-pushed the test/ibis/dtypes branch 5 times, most recently from b0c7bce to f06eaa5 Compare August 1, 2024 04:49
@deepyaman
Copy link
Collaborator Author

deepyaman commented Sep 12, 2024

Must have made a mistake when I rebased thus, looking at the diff; let me check...

Oh, I forgot to include #1766, even though this was build on top of that, hence the failures. Since that's merged, I just rebased onto ibis-dev; hopefully it will pass. 🤞

@deepyaman
Copy link
Collaborator Author

CI issue fixed, should be good to go!

Copy link
Collaborator

@cosmicBboy cosmicBboy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @deepyaman! Just have a quick question about the test

"""Get a strategy for an Ibis table of a given dtype."""
return memtables(
cols=2,
allowed_dtypes=dtype.to_polars(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the conversion to polars dtype?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/deepyaman/pandera/blob/45252183baab6b91416f7373a302ca40979c1e55/tests/ibis/test_ibis_dtypes.py#L30 arguments are passed directly to dataframes strategy from Polars, and then I'm just constructing the ibis.memtable from a Polars dataframe.

@cosmicBboy cosmicBboy merged commit 065a0cb into unionai-oss:ibis-dev Sep 14, 2024
154 of 155 checks passed
@deepyaman deepyaman deleted the test/ibis/dtypes branch September 14, 2024 16:00
@deepyaman deepyaman mentioned this pull request Nov 12, 2024
deepyaman added a commit to deepyaman/pandera that referenced this pull request Dec 24, 2024
* Implement minimal `coerce` and corresponding tests

Signed-off-by: Deepyaman Datta <[email protected]>

* Do not exclude 3.9 in Ibis CI, and regenerate reqs

Signed-off-by: Deepyaman Datta <[email protected]>

---------

Signed-off-by: Deepyaman Datta <[email protected]>
deepyaman added a commit to deepyaman/pandera that referenced this pull request Dec 24, 2024
* Implement minimal `coerce` and corresponding tests

Signed-off-by: Deepyaman Datta <[email protected]>

* Do not exclude 3.9 in Ibis CI, and regenerate reqs

Signed-off-by: Deepyaman Datta <[email protected]>

---------

Signed-off-by: Deepyaman Datta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants